<?php
if($_POST['genre']=="category") {
	$category=new Category($_POST['id']);
		if(isset($_POST['save1'])) {
			$p1=Post::getFromName(addslashes($_POST['art1'])); Post::setFocusedPosts($_POST['id'],0,0, 1,$p1['id']);
			$p2=Post::getFromName(addslashes($_POST['art2'])); Post::setFocusedPosts($_POST['id'],0,0, 2,$p2['id']);
			$p3=Post::getFromName(addslashes($_POST['art3'])); Post::setFocusedPosts($_POST['id'],0,0, 3,$p3['id']);
		}
		if(isset($_POST['save2'])) {
			$vid1=Video::getFromName(addslashes($_POST['vid1'])); Video::setFocusedVideos($_POST['id'],0,0, 1,$vid1['id']);
			$vid2=Video::getFromName(addslashes($_POST['vid2'])); Video::setFocusedVideos($_POST['id'],0,0, 2,$vid2['id']);	
			$vid3=Video::getFromName(addslashes($_POST['vid3'])); Video::setFocusedVideos($_POST['id'],0,0, 3,$vid3['id']);
				


		}
		if(isset($_POST['save3'])) {
			$evt1=Event::getFromName(addslashes($_POST['evt1'])); Event::setFocusedEvents($_POST['id'],0,0, 1,$evt1['id']);
			$evt2=Event::getFromName(addslashes($_POST['evt2'])); Event::setFocusedEvents($_POST['id'],0,0, 2,$evt2['id']);	
			$evt3=Event::getFromName(addslashes($_POST['evt3'])); Event::setFocusedEvents($_POST['id'],0,0, 3,$evt3['id']);

		}
}
elseif($_POST['genre']=="subcategory") {
	if(isset($_POST['save1'])) {
		$p1=Post::getFromName(addslashes($_POST['art1'])); Post::setFocusedPosts(0,$_POST['id'],0, 1,$p1['id']);
		$p2=Post::getFromName(addslashes($_POST['art2'])); Post::setFocusedPosts(0,$_POST['id'],0, 2,$p2['id']);
		$p3=Post::getFromName(addslashes($_POST['art3'])); Post::setFocusedPosts(0,$_POST['id'],0, 3,$p3['id']);

	}
	if(isset($_POST['save2'])) {

	$vid1=Video::getFromName(addslashes($_POST['vid1'])); Video::setFocusedVideos(0,$_POST['id'],0, 1,$vid1['id']);
	$vid2=Video::getFromName(addslashes($_POST['vid2'])); Video::setFocusedVideos(0,$_POST['id'],0, 2,$vid2['id']);	
	$vid3=Video::getFromName(addslashes($_POST['vid3'])); Video::setFocusedVideos(0,$_POST['id'],0, 3,$vid3['id']);
	}
	if(isset($_POST['save3'])) {
		$evt1=Event::getFromName(addslashes($_POST['evt1'])); Event::setFocusedEvents(0,$_POST['id'],0, 1,$evt1['id']);
		$evt2=Event::getFromName(addslashes($_POST['evt2'])); Event::setFocusedEvents(0,$_POST['id'],0, 2,$evt2['id']);	
		$evt3=Event::getFromName(addslashes($_POST['evt3'])); Event::setFocusedEvents(0,$_POST['id'],0, 3,$evt3['id']);

	}	
}
elseif($_POST['genre']=="subsubcategory"){
	$subsubcategory=new SubSubcategory($_POST['id']);
	if(isset($_POST['save1'])) {
		$p1=Post::getFromName(addslashes($_POST['art1'])); Post::setFocusedPosts(0,0,$_POST['id'], 1,$p1['id']);
		$p2=Post::getFromName(addslashes($_POST['art2'])); Post::setFocusedPosts(0,0,$_POST['id'], 2,$p2['id']);
		$p3=Post::getFromName(addslashes($_POST['art3'])); Post::setFocusedPosts(0,0,$_POST['id'], 3,$p3['id']);

	}
	if(isset($_POST['save2'])) {
	$vid1=Video::getFromName(addslashes($_POST['vid1'])); Video::setFocusedVideos(0,0,$_POST['id'], 1,$vid1['id']);
	$vid2=Video::getFromName(addslashes($_POST['vid2'])); Video::setFocusedVideos(0,0,$_POST['id'], 2,$vid2['id']);	
	$vid3=Video::getFromName(addslashes($_POST['vid3'])); Video::setFocusedVideos(0,0,$_POST['id'], 3,$vid3['id']);
	}
	if(isset($_POST['save3'])) {
		$evt1=Event::getFromName(addslashes($_POST['evt1'])); Event::setFocusedEvents(0,0,$_POST['id'], 1,$evt1['id']);
		$evt2=Event::getFromName(addslashes($_POST['evt2'])); Event::setFocusedEvents(0,0,$_POST['id'], 2,$evt2['id']);	
		$evt3=Event::getFromName(addslashes($_POST['evt3'])); Event::setFocusedEvents(0,0,$_POST['id'], 3,$evt3['id']);

	}
}







?>